package cn.edu.scau.cmi.zeyang.abstractfactory;

import cn.edu.scau.cmi.zeyang.domain.insurance.AutomobileDamageInsurance;
import cn.edu.scau.cmi.zeyang.domain.insurance.BodilyInjuryInsurance;
import cn.edu.scau.cmi.zeyang.domain.insurance.CasualtiesInsurance;
import cn.edu.scau.cmi.zeyang.domain.insurance.Insurance;
import cn.edu.scau.cmi.zeyang.domain.insurance.MultipleAccidentsInsurance;

public class PICCFactory extends AbstractFactory{

	@Override
	public Insurance createInsurance(String type){
		Insurance insurance;
		switch (type) {
		case "司机受伤":
			insurance = new BodilyInjuryInsurance();
			break;
		case "汽车损坏":
			insurance = new AutomobileDamageInsurance();
			break;
		case "人员伤亡":
			insurance = new CasualtiesInsurance();
			break;
		case "多种事故":
			insurance = new MultipleAccidentsInsurance();
			break;
		default:
			insurance = null;
		}
		return insurance;
	}

}
